<template>
  <div class='member-order-detail-page'>
    <order-header :order="order"></order-header>
    <order-step :order="order"></order-step>
    <order-logistics v-if="'3,4,5'.includes(order.orderState)" :order="order"></order-logistics>
    <order-info :order="order"></order-info>
  </div>
</template>

<script>
import OrderHeader from './components/order-header'
import OrderStep from './components/order-step'
import OrderLogistics from './components/order-logistics.vue'
import OrderInfo from './components/order-info.vue'
export default {
  name: 'member-order-detail-page',
  components: { OrderHeader, OrderStep, OrderLogistics, OrderInfo },
  data () {
    return {
      order: {}
    }
  },
  created () {
    this.getOrderDetail()
  },
  beforeRouteUpdate (to, from, next) {
    next()
    this.getOrderDetail()
  },
  methods: {
    getOrderDetail () {
      this.$http.get('member/order/' + this.$route.params.id).then(res => {
        this.order = res.data.result
      })
    }
  }
}
</script>

<style scoped lang='less'></style>
